<?php /* Update Configuration Controller */
	require_once('modules/configuration/actions/update/scripts/validate-configuration.php');
	if (isset($_POST['form-action'])) {
		$validacion = validarConfiguracion();
		if (!empty($validacion)) { //fallo validacion
			$validacion = 'ERROR: '.implode(',', $validacion);
			$nombre = $configuration->getNombre();
			$apellido = $configuration->getApellido();
			$email = $configuration->getEmail();
			$estado = $configuration->getEstado();
			$celular = $configuration->getCelular();
			$telefono = $configuration->getTelefono();
			$domicilio = $configuration->getDomicilio();
			$barrio = $configuration->getBarrio();
			$ciudad = $configuration->getCiudad();
			$provincia = $configuration->getProvincia();
			$pais = $configuration->getPais();
			$idioma = $configuration->getIdioma();
			$huso_horario = $configuration->getHusoHorario();
			require_once('modules/configuration/actions/update/view/update-configuration.php');
		} else { //si valido correcto
			$configuration->update(1);
			$result = $configuration->getAllFrom(1);
			if ($result) { //valida si existe la id.
				$nombre = $configuration->getNombre();
				$apellido = $configuration->getApellido();
				$email = $configuration->getEmail();
				$celular = $configuration->getCelular();
				$telefono = $configuration->getTelefono();
				$domicilio = $configuration->getDomicilio();
				$barrio = $configuration->getBarrio();
				$ciudad = $configuration->getCiudad();
				$provincia = $configuration->getProvincia();
				$pais = $configuration->getPais();
				$idioma = $configuration->getIdioma();
				$huso_horario = $configuration->getHusoHorario();
				require_once('modules/configuration/actions/update/view/update-configuration.php');
			}
		}
	} else {
		$result = $configuration->getAllFrom(1);
		if ($result) { //valida si existe la id.
			$nombre = $configuration->getNombre();
			$apellido = $configuration->getApellido();
			$email = $configuration->getEmail();
			$celular = $configuration->getCelular();
			$telefono = $configuration->getTelefono();
			$domicilio = $configuration->getDomicilio();
			$barrio = $configuration->getBarrio();
			$ciudad = $configuration->getCiudad();
			$provincia = $configuration->getProvincia();
			$pais = $configuration->getPais();
			$idioma = $configuration->getIdioma();
			$huso_horario = $configuration->getHusoHorario();
			require_once('modules/configuration/actions/update/view/update-configuration.php');
		} else {
			echo '<strong>No tiene permiso.</strong>';
		}
	}
?>